package com.leon.learnenginespace.drools.utils.operation.impl;

import com.leon.learnenginespace.drools.utils.MathUtils;
import com.leon.learnenginespace.drools.utils.operation.IOperationBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LengthGreaterEqualsOperation implements IOperationBase {
    @Autowired
    private GreaterEqualsOperation greaterEqualsOperation;
    /**
     * v1.length>=v2、v1.length>=v2.length、v1>=v2.length
     * @param v 值
     * @return
     */
    @Override
    public Boolean operation(String dataType,Object ...v) {
        // v1.length>=v2
        Object v1 = v[0];
        Object v2 = v[1];
       int v1Size = MathUtils.getLength(v1);
//       int v2Size = MathUtils.getLength(v2);
       return greaterEqualsOperation.operation("date",v1Size, v2);
    }
}
